import pandas as pd
from sklearn.datasets import fetch_california_housing
from sklearn.model_selection import train_test_split
from sklearn.ensemble import GradientBoostingRegressor as GBDT


def main():
    california = fetch_california_housing()
    x_train, x_test, y_train, y_test = train_test_split(
        california.data, california.target)

    model = GBDT(n_estimators=50)
    model.fit(x_train, y_train)

    train_score = model.score(x_train, y_train)
    test_score = model.score(x_test, y_test)

    print("train score:", train_score)
    print(" test score:", test_score)

    # print(california.DESCR)
    df = pd.DataFrame(
        data=california.data,
        columns=california.feature_names
    )
    print(df)


if __name__ == '__main__':
   main()